package cn.sh.library.gmwx.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.sh.library.gmwx.bean.InstanceSearchBean;
import cn.sh.library.gmwx.bean.PersonSearchBean;
import cn.sh.library.gmwx.bean.WorkSearchBean;
import cn.sh.library.gmwx.dto.Pager;
import cn.sh.library.gmwx.dto.QueryResult;
import cn.sh.library.gmwx.service.BookService;
import cn.sh.library.gmwx.service.PersonService;
import cn.sh.library.gmwx.sparql.InstanceSparql;
import cn.sh.library.gmwx.sparql.PersonSparql;
import cn.sh.library.gmwx.sparql.WorkSparql;


@Service
public class PersonServiceImpl implements PersonService {
    @Resource
    private PersonSparql personSparql;

    @Override
    public List<Map<String, Object>> list(PersonSearchBean search, Pager pager) {
    	String order = "";
        QueryResult<Map<String, Object>> queryResult = this.personSparql.getCpcPersons(search, pager, order);

        pager.calcPageCount(queryResult.getTotalrecord());
        pager.setRowCount(queryResult.getTotalrecord());
        return queryResult.getResultList();
    }

    @Override
    public Map<String, Object> info(String uri) {
        return this.personSparql.getCpcPersonInfo(uri);
    }
}
